<?php

/**
 * @file
 * Custom theme implementation to display a single Drupal page.
 */

?>

<!-- Navbar -->
<div id="navbar" class="navbar navbar-medium navbar-inverse navbar-static-top">
  <div class="navbar-inner">
    <div class="container">
      <div class="header-links">
        <?php if ($secondary_menu): ?>
          <?php print '欢迎，' ?>
          <div class="pull-right">
            <a href="<?php echo base_path(); ?>app/download"><img src="<?php echo base_path();?>sites/all/themes/tweme/images/images/14.png" width="20px" height="20px"><?php print '手机聚农360' ?></a>&nbsp;&nbsp;&nbsp;
            <?php if ($logged_in) : ?>
              <?php if($page['alert_messages']){ print '消息'.$page['alert_messages'];}else{print "<a onclick=\"javascript:void window.open('".base_path()."contact/list','1446518728896', 'width=542,height=670,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;\"><img src='".base_path()."sites/all/themes/tweme/images/images/zx.png' width='20px' height='20px'>咨询/投诉</a>";} ?>
            <?php endif ?>
            <?php if (!$logged_in) : ?>
              <a onclick="javascript:void window.open('<?php echo base_path(); ?>contact/list','1446518728896', 'width=542,height=670,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;"><img src='<?php echo base_path();?>sites/all/themes/tweme/images/images/zx.png' width='20px' height='20px'>咨询/投诉</a>
            <?php endif ?>
          </div>
          <span class="line1">
          <?php foreach ($secondary_menu as $item): ?>
            <?php print l($item['title'], $item['href']) ?>
          <?php endforeach ?>
          </span>
        <?php if (!$logged_in) : ?>
          <a href="<?php echo base_path();?>csna/qq"><img src="<?php echo base_path();?>sites/all/themes/tweme/images/images/qq.png" width="20px" height="20px"><?php print '用QQ账号登录' ?></a>
          <?php endif ?>
        <?php endif ?>
      </div>
    </div>
  </div>
</div>


<!-- Header -->
<header id="header" class="container-wrapper">
  <div class="container">
    <a href="<?php print check_url($front_page) ?>">
      <div class="logo">
        <img src="<?php print base_path() . drupal_get_path('theme', 'tweme') . '/images/logo.png'; ?>"/>
      </div>
    </a>
    <?php if ($page['search']): ?>
      <?php print render($page['search']) ?>
    <?php endif ?>
    <!--    --><?php //if ($preface): ?>
    <!--      --><?php //print $preface ?>
    <!--    --><?php //endif ?>
    <img src="<?php print base_path() . drupal_get_path('theme', 'tweme') . '/images/images/junong360.png'; ?>" class="front-ewm-img"/>
  </div>
</header>


<!-- Main -->
  <?php if ($page['main_menu']): ?>
    <!-- Main Menu -->
    <div id="main_menu" class="container-wrapper hidden-phone">
      <!--      <div class="container">-->
      <?php print render($page['main_menu']) ?>
      <!--      </div>-->
    </div>
  <?php endif ?>
  <div class="container">
    <?php print $messages ?>
    <div class="row-fluid">
      <?php if ($has_sidebar_first): ?>
        <!-- Sidebar first -->
        <aside id="sidebar-first" class="sidebar span3 hidden-phone">
          <?php print render($page['sidebar_first']) ?>
          <?php print render($page['sidebar_first_affix']) ?>
        </aside>
      <?php endif ?>
    </div>
  </div>
<!--首页左边-->
<div class="front-all">
<div class="front-left">
  <div class="agricultural-page">
  <!--    <div class="big-agricultural">-->
  <!--      --><?php //print views_embed_view('front_agricultural_active_big_image','page');?>
  <!--    </div>-->
      <div  class="front-first">
          <div class="front-title long-front-title"><a href="<?php echo base_path(); ?>node-list/knowledge">最新资讯</a></div>
          <?php print views_embed_view('front_agricultural_active','page');?>
      </div>
  </div>
  <div class="front-advert-one">
    <?php print views_embed_view('front_oblong_image','page','809');?>
<!--    <img src="--><?php //echo base_path();?><!--sites/all/themes/tweme/images/images/one.jpg">-->
  </div>
  <div class="knowledge-page">
    <div class="front-three">
      <div class="front-title short-front-title"><a href="<?php echo base_path(); ?>node-list/knowledge">农技知识</a></div>
      <?php print views_embed_view('front_agricultural_market','page','knowledge');?>
    </div>
    <div class="front-three">
      <div class="front-title short-front-title"><a href="<?php echo base_path(); ?>node-list/case">产品故事</a></div>
      <?php print views_embed_view('front_agricultural_market','page','case');?>
    </div>
  </div>
  <div class="front-advert-two">
    <?php print views_embed_view('front_oblong_image','page','810');?>
<!--    <img src="--><?php //echo base_path();?><!--sites/all/themes/tweme/images/images/two.jpg">-->
  </div>
  <div class="knowledge-page">
    <div class="front-three">
      <div class="front-title short-front-title"><a href="<?php echo base_path(); ?>node-list/knowledge">农业动态</a></div>
      <?php print views_embed_view('front_agricultural_market','page','news');?>
    </div>
    <div class="front-three">
      <div class="front-title short-front-title"><a href="<?php echo base_path(); ?>node-list/knowledge">农资市场</a></div>
      <?php print views_embed_view('front_agricultural_market','page','market');?>
    </div>
  </div>
</div>


<!--首页右边-->
<div class="front-right">
  <div class="front-advert-three">
    <?php print views_embed_view('front_oblong_image','page','811');?>
<!--    <img src="--><?php //echo base_path();?><!--sites/all/themes/tweme/images/images/three.jpg">-->
  </div>
  <div class="small-hot-case">
    <div class="small-title"> 最新咨询 </div>
    <?php print views_embed_view('front_consult_list','block');?>
  </div>
  <div class="front-three" style="margin-top: 30px;">
    <div class="small-hot-case">
<!--    <img src="--><?php //echo base_path();?><!--sites/all/themes/tweme/images/images/forum-title.png">-->
    <div class="small-title"> 社区热点 </div>
    <?php print views_embed_view('front_forum_list','block');?>
    </div>
  </div>
  <?php global $user;
  $user_info = _get_user_info($user->uid);
  if($user_info['uid'] != 0){?>
    <div class="small-hot-case">
      <div class="small-title"> 个人信息 </div>
      <div style="padding: 15px;">
        <img src="<?php echo _get_user_profile(); ?>" width="80px" height="80px" style="border-radius: 50%;float: left"/>
        <ul class="front-ul">
          <li>用户名:<?php echo $user->name; ?></li>
          <li>上次登录时间:<?php echo date('Y-m-d',$user->access); ?></li>
          <li>用户类型:<?php echo $user_info['role']; ?></li>
        </ul>
      </div>
    </div>
  <?php }?>
</div>
</div>
<div class="clearfix"></div>
<?php if ($page['footer']): ?>
  <!-- footer -->
  <footer id="footer" class="container-wrapper">
    <div class="container">
      <?php print render($page['footer']) ?>
    </div>
  </footer>
<?php endif ?>

